[TEP-0056]: Pipelines in Pipelines happy path using PipelineSpec property.#1
Open
[TEP-0056]: Pipelines in Pipelines happy path using PipelineSpec property.#1
PipelineSpec property.#1Conversation
PipelineSpec property.PipelineSpec property. 🚧
PipelineSpec property. 🚧 PipelineSpec property. 🚧
PipelineSpec property. 🚧 PipelineSpec property. 🚧
f694a52 to
6dcce21
Compare
68fe10b to
a19b14d
Compare
e1b00f0 to
6fb3c12
Compare
6fb3c12 to
37839ed
Compare
98949df to
23e000f
Compare
twoGiants
commented
Jul 10, 2025
twoGiants
commented
Jul 10, 2025
twoGiants
commented
Jul 10, 2025
twoGiants
commented
Jul 10, 2025
PipelineSpec property. 🚧 PipelineSpec property.
d5324fc to
c532220
Compare
[TEP-0056] Child `PipelineRuns` (PinP) are created by the `PipelineRun` reconciler, equal to the `TaskRun/CustomRun` implementations. An event handler for child `PipelineRuns` is registered in controller entrypoint. This will trigger the reconciliation loop when child `PipelineRuns` change their state. Extend `ResolvedPipelineTask` data structure to store child `PipelineRuns` and the resolved pipeline in `ResolvedPipeline` data structure equal to `ResolvedTask`. Add `GetPipelineRun` function alias for convenience. Add condition to `func ResolvePipelineTask` which checks if the given `PipelineTask` is a `Pipeline` and resolves it by getting the actual spec. In our "happy path" case it's right on the `PipelineTask` because we use `PipelineSpec` and don't need to fetch it from anywhere. A few downstream methods equal to resolving a `TaskRun` were added. Extend `resolvePipelineState` with getter for child `PipelineRuns` using lister and extend `runNextSchedulableTask` with a condition check for a `PipelineTask` which is a `Pipeline` and implement the creation of a new `PipelineRun` from the resolved pipeline state and pipeline facts. To get the status of the child `PipelineRun` success and failure checks were added to the `PipelineRun` types and extended in the resolution methods. Test were added to cover the new public methods. Setting the `ChildReferences` was extended for child `PipelineRuns`. Extract getTask/-Run/Run functions in `pipelinerunresolution_test.go`. The function declarations were duplicated up to 10 times. Now they are extracted and generalized to a large extent. Rename label/annotation factory. Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
Remove unused code and helper functions from PipelineRun e2e tests. Fix typos premption => preemption. Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
Switch to IsChildPipeline method. Fix typos and change wording in docs. Add child pipeline check to `isFailure`. Issues tektoncd#8760, tektoncd#7166.
Add mock PipelineRun factory and PipelineRun condition transition functions. Now that it also includes child PipelineRuns in its check additional tests with mock data were added. Add `getNextTasks` tests. Now that `DAGExecutionQueue` downstream takes child (PinP) pipelines into account, additional tests were added. Now that `GetPipelineConditionStatus` downstream takes child (PinP) pipelines into account, additional test cases with necessary mock data were added. Now that `AdjustStartTime` takes child (PinP) pipelines into account, additional tests cases were added. Now that `GetPipelineTaskStatus` takes child (PinP) pipelines into account, additional test cases were added. `GetTaskRunsResults` now also skips over child (PinP) pipelines when getting the TaskRun results. One test case was added to test skipping the child `PipelineRun`. Now that `GetChildReferences` takes child (PinP) into account, additional tests were added. Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
Now that `getReason` takes child (PinP) into account, additional tests were added. This commit does not contain tests for a matrixed task. Those will be added once the matrix feature for child (PinP) PipelineRuns is implemented. Now that `isFailure` takes child (PinP) into account, additional tests were added. Now that `isSuccessful` takes child (PinP) into account, additional tests were added. Test that the pipeline state contains the resolved child (PinP) pipeline , the correct child `PipelineRun` name and the child `PipelineRun` if there is any. Issues tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
The test setup is a parent pipeline with one or more embedded child/grandchild pipelines using the `PipelineSpec` (alpha) field. It follows the given-when-then test flow arrangement. The pipeline manifests yaml definitions use variables for every field which is validated. Multiple helper functions were created equal to reconciliation unit tests for TaskRuns/CustomRuns: - `testing.OnePipelineInPipeline` - `testing.TwoPipelinesInPipelineMixedTasks` - `testing.NestedPipelinesInPipeline` - `parse.MustParseChildPipelineRunWithObjectMeta` - `reconcileOncePinP` - `validatePinP` - `getChildPipelineRunsForPipelineRun` - `getChildPipelineRunByName` - `validateChildPipelineRunCount` - `getChildPipelineRunByName` - `testing.VerifyChildPipelineRunStatusesCount` - `testing.VerifyChildPipelineRunStatusesNames` - `testing.childPipelineRunWithObjectMeta` Test data factory functions were put in the `testing` package in the `factory.go` file. The test validates: - the status and condition of the parent PipelineRuns which should trigger the creation of the child PipelineRuns, - the actual created child/grandchild PipelineRuns if they have the correct metadata i.e. name, owner reference, etc. and the embedded pipelines from the `PipelineSpec` fields in the pipeline tasks of the parent pipeline. Similar checks are performed in `TestReconcile` for `TaskRun` and in `TestReconcile_V1Beta1CustomTask` for `CustomTasks`. Add annotations/label propagation tests: - `TestReconcile_PropagateLabelsAndAnnotationsToChild` - `TestReconcile_ChildPipelineRunHasDefaultLabels` Aadd child pipeline creation error tests. New table driven test `TestReconcile_ChildPipelineRunCreationError` and test framework additions: - `type clientErrors` - `reconcileWithError` `reconcileWithError` can be reused in every test with fake client error returns i.e. where `Pipeline.PrependReactor` is used. Add e2e child pipeline tests. The test setup is a parent pipeline with one or more embedded child/grandchild pipelines using the `PipelineSpec` (alpha) field equal to the reconciliation unit tests. The e2e tests also follow the Given-When-Then test structure. The pipeline manifests yaml definitions use variables for every field which is validated. Multiple helper functions were created equal to PipelineRun e2e tests: - `setupPinP` - `tearDownOptDump` - `createKindsMap` - `assertPinP` - `createResourcesAndWaitForPipelineRun` - `checkLabelPropagationToChildPipelineRun` - `checkAnnotationPropagationToChildPipelineRun` - `assertEvents` The tests validate: - parent PipelineRun creation, - child PipelineRun creation, - successful finish of all resources, - correct label and annotation propagation, - amount of events published. Similar checks are performed in `TestPipelineRun|TestPipelineRunStatusSpec|...` for `TaskRun` and in `TestCustomTask` for `CustomTask`. Issues tektoncd#8760, tektoncd#7166 Signed-off-by: Stanislav Jakuschevskij <[email protected]>
c532220 to
85ce1b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes